home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
text
/
dtp
/
SendToCED1_1.lha
/
SendToCygnusED
/
SendToCygnusED.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1995-02-05
|
2KB
|
96 lines
/*
$VER: SendToCygnusEd.rexx 1.1 (05.01.95)
Copyright 1994-95 kMel, Klaus Melchior
Source adapted from
"SendToPageLiner.rexx" Copyright 1994 Soft-Logik Publishing Corporation
*/
OPTIONS RESULTS
TRACE OFF
/* Make sure rexx support is opened */
IF ~SHOW('L','rexxsupport.library') THEN
CALL ADDLIB('rexxsupport.library',0,-30)
ADDRESS 'PAGESTREAM'
/*** If text is not selected, select the current article ***/
getcursor characterstart sID characterend eID
IF sID = eID THEN 'selecttext all'
/*** Export the article to a temp file ***/
'lockinterface true'
'exporttext file t:HotLinkedArticle filter ascii textcode PageStream status force'
'refresh wait'
/*** default ***/
preffile = 'PageStream3:SendToCygnusEd.prefs'
invokepath = "Ed"
/*** get the path of the invoker ***/
IF OPEN(.ifile, preffile, 'R') THEN DO
invokepath = READLN(.ifile)
CALL CLOSE(.ifile)
askuser='no'
END
ELSE DO
askuser='yes'
END
/*** If the invoker path doesn't exist in the prefs, ask the user where it is ***/
IF ~EXISTS(invokepath) | askuser = 'yes' THEN DO
GetFile Title "'Please locate ED - the invoker of CygnusEd'" Load File invokepath PosButton 'Ok' NegButton 'Cancel'
IF RC = 10 THEN SIGNAL Cancel
invokepath = RESULT
IF OPEN(.ifile, preffile, 'W') THEN DO
CALL WRITELN(.ifile, invokepath)
CALL CLOSE(.ifile)
END
END
/*** If the invoker didn't exists, alert the user and exit ***/
IF ~EXISTS(invokepath) THEN DO
ADDRESS 'PAGESTREAM'
allocarexxrequester '"Send to Editor Error!"' 368 59
reqhandle = RESULT
addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
Exithandle = RESULT
addarexxgadget reqhandle TEXT 8 10 352 border none string "'Invoker of CygnusEd could not be found.'"
doarexxrequester reqhandle
freearexxrequester reqhandle
'refresh continue'
'lockinterface false'
EXIT
END
ADDRESS COMMAND invokepath 't:HotLinkedArticle -sticky'
/*** Update PageStream and exit ***/
Update:
ADDRESS 'PAGESTREAM'
'ScreenToFront'
'inserttext file t:HotLinkedArticle filter ascii textcode PageStream'
/*** deselect the text if required ***/
IF sID = eID THEN selecttext none
SIGNAL Cancel
Cancel:
ADDRESS 'PAGESTREAM'
'refresh continue'
'lockinterface false'
ADDRESS COMMAND 'delete t:HotLinkedArticle'
EXIT